<div class="problemindexholder" problemindex="C">
 <div class="ttypography">
  <div class="problem-statement">
   <div class="header">
    <div class="title">
     C. Maximum splitting
    </div>
    <div class="time-limit">
     <div class="property-title">
      time limit per test
     </div>
     2 seconds
    </div>
    <div class="memory-limit">
     <div class="property-title">
      memory limit per test
     </div>
     256 megabytes
    </div>
    <div class="input-file">
     <div class="property-title">
      input
     </div>
     standard input
    </div>
    <div class="output-file">
     <div class="property-title">
      output
     </div>
     standard output
    </div>
   </div>
   <div>
    <p>
     You are given several queries. In the
     <span class="tex-span">
      <i>
       i
      </i>
     </span>
     -th query you are given a single positive integer
     <span class="tex-span">
      <i>
       n
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     . You are to represent
     <span class="tex-span">
      <i>
       n
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     as a sum of maximum possible number of composite summands and print this maximum number, or print
     <span class="tex-font-style-tt">
      -1
     </span>
     , if there are no such splittings.
    </p>
    <p>
     An integer greater than
     <span class="tex-span">
      1
     </span>
     is composite, if it is not prime, i.e. if it has positive divisors not equal to
     <span class="tex-span">
      1
     </span>
     and the integer itself.
    </p>
   </div>
   <div class="input-specification">
    <div class="section-title">
     Input
    </div>
    <p>
     The first line contains single integer
     <span class="tex-span">
      <i>
       q
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       q
      </i>
      ≤ 10
      <sup class="upper-index">
       5
      </sup>
     </span>
     ) — the number of queries.
    </p>
    <p>
     <span class="tex-span">
      <i>
       q
      </i>
     </span>
     lines follow. The (
     <span class="tex-span">
      <i>
       i
      </i>
      + 1
     </span>
     )-th line contains single integer
     <span class="tex-span">
      <i>
       n
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       n
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤ 10
      <sup class="upper-index">
       9
      </sup>
     </span>
     ) — the
     <span class="tex-span">
      <i>
       i
      </i>
     </span>
     -th query.
    </p>
   </div>
   <div class="output-specification">
    <div class="section-title">
     Output
    </div>
    <p>
     For each query print the maximum possible number of summands in a valid splitting to composite summands, or
     <span class="tex-font-style-tt">
      -1
     </span>
     , if there are no such splittings.
    </p>
   </div>
   <div class="sample-tests">
    <div class="section-title">
     Examples
    </div>
    <div class="sample-test">
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>1<br/>12<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>3<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>2<br/>6<br/>8<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>1<br/>2<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>3<br/>1<br/>2<br/>3<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>-1<br/>-1<br/>-1<br/></pre>
     </div>
    </div>
   </div>
   <div class="note">
    <div class="section-title">
     Note
    </div>
    <p>
     <span class="tex-span">
      12 = 4 + 4 + 4 = 4 + 8 = 6 + 6 = 12
     </span>
     , but the first splitting has the maximum possible number of summands.
    </p>
    <p>
     <span class="tex-span">
      8 = 4 + 4
     </span>
     ,
     <span class="tex-span">
      6
     </span>
     can't be split into several composite summands.
    </p>
    <p>
     <span class="tex-span">
      1, 2, 3
     </span>
     are less than any composite number, so they do not have valid splittings.
    </p>
   </div>
  </div>
  <p>
  </p>
 </div>
</div>
